<?php
class fileUpload extends control 
{
	private $dir;
	private $file;
	
	public function __construct(){
		parent::__construct();
		$this->dir = $this->loadModel('dir');
		$this->file = $this->loadModel('file');
		$load_lib = array('upload'=>'upload','image'=>'image');
		$this->loadClass($load_lib);

	}
	public function index() {}
	
	public function AdvancedUpload() {
		
	}
	
	public function simpleUpload() {
		$dir_id = $this->load->input->post('dir_id');
		if($dir_id == 'undefined') $dir_id = '7';
		
		$file_url = $this->load->upload->filesUpload('upload',$this->user_name,$dir_id,$this->user_id);
		
		$result = $this->load->image->createThumbnail($file_url);//生成缩略图
		
		if($result !== false) {
			echo '文件上传成功';
		}	
	}
}
?>
